# $Id: PKGBUILD 58244 2011-11-09 07:27:09Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Maciej Sitarz <macieks@freesco.pl>

pkgname=firefox-spell-ru
pkgver=0.4.4
pkgrel=12
pkgdesc="Russian spellchecker dictionary for Firefox"
arch=(any)
url="https://addons.mozilla.org/firefox/dictionaries/"
license=("GPL")
depends=("firefox")
noextract=(russian_spellchecking_dictionary_with_io_support-$pkgver-fx+tb+sm.xpi)
source=(https://addons.mozilla.org/firefox/downloads/file/98798/russian_spellchecking_dictionary-$pkgver-fx+tb+sm.xpi)
md5sums=('269a8bdd38a5641b5f6cfb12715f1029')

build() {
#  _ffver=`pacman -Q firefox | cut -f2 -d\ | cut -f1 -d-`
#  depends=("firefox>=${_ffver}" "firefox<=${_ffver/0/99}")

  cd $srcdir
  rm $srcdir/*.xpi
  local _dir=$pkgdir/usr/lib/firefox/extensions/ru@dictionaries.addons.mozilla.org
  mkdir -p "${_dir}"
  cd "${_dir}"
  sed -i 's#<em:maxVersion>.*</em:maxVersion>#<em:maxVersion>20.*</em:maxVersion>#' $srcdir/install.rdf
  cp -r $srcdir/* "${_dir}"
  find ${_dir} -type f -exec chmod 0644 {} \;
  touch ${_dir}/chrome.manifest
}
